<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<ul>
    <li>text1</li>
    <li>text2</li>
    <li>text3</li>
    <li>text4</li>
    <li>text5</li>
</ul>

<script>
    /*
    * 1.解构赋值  别名
    * */
    let obj = {
        name : "es6",
        age : 2015,
        type: {
            name: "ECMAScript"
        }
    };

    //name: trueName   =>别名(小名)
    const {name: trueName, age, type: {name}} = obj;
    console.log(trueName, age, name);

    const {name: n, family: {father: f}} = {
        name: 'Tom Jones',
        family: {
            mother: 'Norah Jones',
            father: 'Richard Jones',
            brother: 'Howard Jones'
        },
        age: 25
    };
    console.log("---------n,f------------",n, f);

    /*
    * 展开运算符
    * */
    let list = document.getElementsByTagName("li");
    console.log("list=========>",list,); //伪数组(类数组);
    console.log("list展开=========>");
    console.log([...list]);
//    let listArr = Array.prototype.slice.call(list);
    let listArr = [...list]; //伪数组转换成数组
    console.log("listArr=========>",listArr);


    //展开运算符前拷贝
    let arr2 = [6,7,8];
    let arr = [1,2,3,{"a":1},5, ...arr2];
    console.log(arr)

/*    console.log(arr === arr2);  //???

//    let arr3 = arr.concat(arr2);   join()???
    let arr3 = [...arr, ...arr2];
    console.log(arr3); */





</script>
</body>
</html>